package com.ilink.ilinkcommon.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

public class JsonUtils {
    private static final ObjectMapper MAPPER = new ObjectMapper();
    public static JsonNode toJsonNode(String string) {
        try {
            return MAPPER.readTree(string);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
    public static ObjectNode createObjectNode() {
        return MAPPER.createObjectNode();
    }
}
